package com.sharemarking.wa.common.eum;

/**
 * Created by king on 2018/08/21.
 */
public enum CacheNameEum {
    LOGIN_TOKEN("LOGIN_TOKEN", "登录凭据"),
    UPDATE_MOBILE_VALIDATE_CODE("UPDATE_MOBILE_VALIDATE_CODE", "修改手机号验证码"),
    FIND_PSW_VALIDATE_CODE("FIND_PSW_VALIDATE_CODE", "找回密码验证码"),
    REGISTER_VALIDATE_CODE("REGISTER_VALIDATE_CODE", "注册验证码"),
    BIND_CODE("BIND_CODE", "绑定验证码"),
    LOGIN_VALIDATE_CODE("LOGIN_VALIDATE_CODE", "登录验证码"),
    IP_LOGIN_FAIL_COUNT("IP_LOGIN_FAIL_COUNT", "IP登录失败次数"),
    MOBILE_LOGIN_FAIL_COUNT("MOBILE_LOGIN_FAIL_COUNT", "手机账号登录失败次数"),
    SESSION_KEY("SESSION_KEY","微信会话标识"),
    IMAGE_VALIDATE_CODE("IMAGE_VALIDATE_CODE","登录图形验证码（平台）")
    ;

    private String key;
    private String value;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    private CacheNameEum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String getValue(String index) {
        for (CacheNameEum item : CacheNameEum.values()) {
            if (index == item.getKey()) {
                return item.value;
            }
        }
        return null;
    }

    public String getCacheName() {
        return this.key;
    }
}
